<template>
  <div>
    <template v-for="(item, index) in options">
      <template v-if="id.includes(item.id)">
        <el-tag>
          {{ item.name + ' ' }}
        </el-tag>
      </template>
    </template>
  </div>
</template>

<script>
export default {
  name: "TableTag",
  props: {
    options: {
      type: Array,
      default: null,
    },
    id: [Number, String, Array],
    // 当未找到匹配的数据时，显示value
    showValue: {
      type: Boolean,
      default: true,
    },
    separator: {
      type: String,
      default: ","
    }
  },
  data() {
    return {
      unmatchArray: [], // 记录未匹配的项
    }
  },
};
</script>
<style scoped>
.el-tag + .el-tag {
  margin-left: 10px;
}
</style>
